-
Notifications
You must be signed in to change notification settings - Fork 919
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shutdown the executor service in KubernetesApplicationOperation and prevent NPE #6785
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #6785 +/- ##
======================================
Coverage 0.00% 0.00%
======================================
Files 687 687
Lines 42439 42447 +8
Branches 5793 5796 +3
======================================
- Misses 42439 42447 +8 ☔ View full report in Codecov by Sentry. |
@@ -273,6 +274,16 @@ class KubernetesApplicationOperation extends ApplicationOperation with Logging { | |||
Utils.tryLogNonFatalError(client.close()) | |||
} | |||
kubernetesClients.clear() | |||
|
|||
if (expireCleanUpTriggerCacheExecutor != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may need to be placed before assigning cleanupTerminatedAppInfoTrigger to null.
kyuubi/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
Line 267 in d3520dd
if (cleanupTerminatedAppInfoTrigger != null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, we need to invalidate the cache before shutdown the executor.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So that, the remaining terminated application can be cleaned before server stop.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The non-null check here is not atomic, so NPE may still occur.
kyuubi/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
Line 154 in 78c2a6c
if (cleanupTerminatedAppInfoTrigger == null) return |
🔍 Description
Issue References 🔗
As title.
Fix NPE, because the cleanupTerminatedAppInfoTrigger will be set to
null
.kyuubi/kyuubi-server/src/main/scala/org/apache/kyuubi/engine/KubernetesApplicationOperation.scala
Line 269 in d3520dd
Also shutdown the ExecutorService when KubernetesApplicationOperation stoped.
Describe Your Solution 🔧
Shutdown the thread executor service and check the null.
Types of changes 🔖
Test Plan 🧪
Behavior Without This Pull Request ⚰️
Behavior With This Pull Request 🎉
Related Unit Tests
Checklist 📝
Be nice. Be informative.